<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>车辆基础资料</title>
<link href="<%=path%>/CSS/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

 
 $(document).ready(function(){
/* 
	 $(".tablelink").click(function(){
		  $(".tip").fadeIn(200);
	 });
		  
	$(".tiptop ").click(function(){
		  $(".tip").fadeOut(200);
	});
 */
	  
	  $("#addCar").click(function(){
	   location="insertCar";
	   });
	   
	});
</script>
<style type="text/css">
.seachform li label{line-height: 45px;color: #444444}
.scinput{line-height: 10px;margin-top: 5px}
.scinput1{margin-top: 5px;height: 30px;}
.scbtn{background: #57a0ff;border-radius:20px;width: 110px;margin-top: 4px;height: 35px;outline:none;}
.scbtn2{height: 20px;background: #57a0ff;border-radius:20px;width: 50px;color: #fff;display: none;}

thead {background: #f2f2f2}
tbody tr:nth-child(even) {background: #f7f8fd}
.tablelist th{height: 45px;padding-left: 30px;text-align: center;background: none;border-bottom: none;}
.tablelist td{border-right:none;padding-left: 30px;text-align: center;}
tbody tr{height: 38px}
.check{padding-left: 0px}
a{cursor: pointer;}
.placeul a{color: #444444}
select{border: solid 1px #a7b5bc;margin-top: 5px;appearance:none;}
</style>
</head>
<body style="background: #f5f5f5;padding: 0 10px;">
<div id="location_top">
		<div class="place" style="background: #f5f5f5;margin-top: 10px">
			<ul class="placeul">
				<li><a href="#">预约管理</a></li>
				<li><a href="#">考试预约</a></li>
			</ul>
		</div>
	
		<div class="rightinfo" style="background: #fff;border-radius:10px;height: 90px;">

			<form action="<%=path%>/DrivingSys/selectExamOrderByCon" method="post">
				<ul class="seachform" style="width: 75%;">
					    <li><label>学员名称</label><input name="cfstudentname" type="text" class="scinput" value="${examOrder1.cfstudentname}"/></li>
					    <li><label>身份证号码</label><input name="cfidcardno" type="text" class="scinput" value="${examOrder1.cfidcardno}"/></li>
					    <li><label>手机</label><input name="cfmobile" type="text" class="scinput" value="${examOrder1.cfmobile}"/></li>
						<li style="margin-right: 200px"><label>考试类型</labe l>
							<select style="width: 150px;height: 32px" class="cfbilltype" name="cfbilltype">
								<c:if test="${examOrder1.cfbilltype eq 0 || examOrder1.cfbilltype eq null}">
									<option value="0" selected="selected" style="font-size: 16px"> </option>
									<option value="2" style="font-size: 16px">科目一考试预约</option>
									<option value="3" style="font-size: 16px">科目二考试预约 </option>
									<option value="4" style="font-size: 16px">科目三考试预约</option>
								</c:if>
								<c:if test="${examOrder1.cfbilltype eq 2}">
									<option value="0" style="font-size: 16px"></option>
									<option value="2" selected="selected"  style="font-size: 16px">科目一考试预约</option>
									<option value="3" style="font-size: 16px">科目二考试预约 </option>
									<option value="4" style="font-size: 16px">科目三考试预约</option>
								</c:if>
								<c:if test="${examOrder1.cfbilltype eq 3}">
									<option value="0" style="font-size: 16px"> </option>
									<option value="2" style="font-size: 16px">科目一考试预约</option>
									<option value="3" selected="selected" style="font-size: 16px">科目二考试预约 </option>
									<option value="4" style="font-size: 16px">科目三考试预约</option>
								</c:if>
								<c:if test="${examOrder1.cfbilltype eq 4}">
									<option value="0" style="font-size: 16px"></option>
									<option value="2" style="font-size: 16px">科目一考试预约</option>
									<option value="3" style="font-size: 16px">科目二考试预约 </option>
									<option value="4" selected="selected" style="font-size: 16px">科目三考试预约</option>
								</c:if>
							</select>
						</li>
					    <li><label style="line-height: 22px;vertical-align: middle;display: inline-block">考试日期<br>开始范围</label><input class="scinput1"  name="beginTime" type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'})"
					    id="datemin" class="input-text Wdate" style="width:150px;" value="${beginTime}"></li>
						<li><label style="line-height: 22px;vertical-align: middle;display: inline-block">考试日期<br>结束范围　</label><input class="scinput1"  name="endTime" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',dateFmt:'yyyy-MM-dd'})"
						id="datemax" class="input-text Wdate" style="width:150px;"value="${endTime}"></li>		
						<li><label>&nbsp;</label><input name="" type="submit"  style="outline: none;" class="scbtn" value="立即查询" /></li>
				</ul>
			</form>
		</div>
</div>
<div id="data_table_new"
	 style="margin-bottom: 0px;margin-top: 30px;background: #fff;border-radius:10px;box-shadow: 0 0 10px #f2f2f2;">
			<ul>
				 <li style="height: 40px;text-align: left;color: #999999;">
				  <span style="font-size: 12px;">
				  <shiro:hasPermission name="/addExamOrder">
					  <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;" src="<%=path%>/images/list/xz.png">
					  &nbsp;<a onclick="gotoSelectCard(this)" funurl="<%=path%>/DrivingSys/addExamOrder">新增</a>
				  </shiro:hasPermission>
				  <shiro:hasPermission name="/deleteExamOrderByFid">
					  <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;" src="<%=path%>/images/list/sc.png">
					  &nbsp;<a class="del">删除</a>
				  </shiro:hasPermission>
				  <shiro:hasPermission name="/selectExamOrderByFid">
					  <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;" src="<%=path%>/images/list/xg.png">
					  &nbsp;<a class="update">修改</a>
				  </shiro:hasPermission>
					  <shiro:hasPermission name="/outExamOrderExcel">
					  <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;width: 14px" src="<%=path%>/images/list/excel.png">
					  &nbsp;<a class="outExcel">导出Excle</a>
					  </shiro:hasPermission>
				  </span>
				  
				 </li>
			</ul>
		<table class="tablelist" id="tablelist" style="white-space:nowrap;">
			<thead>
				<tr>
					<th><input type="checkbox" class="check" /></th>
					<th>预约考试日期</th>
					<th>考试类型</th>
					<th>单据编号</th>
					<th>申请现准驾车型号</th>
					<th>学员编码</th>
					<th>学员名称</th>
					<th>VIP</th>
					<th>预约结果</th>
					<th>手机</th>
					<th>电话</th>
					<th>欠费金额</th>
					<th>车型</th>
					<th>备注</th>
					<th>下一次预约时间</th>
					<th>已收金额</th>
					<th>应收金额</th>
					<th>优惠金额</th>
					<th>班级</th>
					<th>身份证号码</th>
					<th>性别</th>
					<th>推荐人</th>
					<th>初考/补考</th>
					<th>技能表交接</th>
					<th>档案交接</th>
					<th>操作</th>
				</tr>
			</thead>
			<c:forEach items="${examOrders}" var="examOrder" varStatus="s">
					<tr class="examOrder">
					<td><input type="checkbox"  name="check"   value="${examOrder.fid}"/></td>
					<td>${examOrder.cfexamdate}</td>
					<c:if test="${examOrder.cfbilltype eq 1}">
					<td>模拟考预约</td>
					</c:if>
					<c:if test="${examOrder.cfbilltype eq 2}">
					<td>科目一考试预约</td>
					</c:if>
					<c:if test="${examOrder.cfbilltype eq 3}">
					<td>科目二考试预约</td>
					</c:if>
					<c:if test="${examOrder.cfbilltype eq 4}">
					<td>科目三考试预约</td>
					</c:if>
					<td>${examOrder.fnumber}</td>
					<td>${examOrder.cfsqzjcxdh}</td>
					<td>${examOrder.cfstudentno}</td>
					<td>${examOrder.cfstudentname}</td>
					<c:if test="${examOrder.cfvip eq 1}">
					<td><input type="checkbox" disabled="disabled" checked="checked" ></td>
					</c:if>
					<c:if test="${examOrder.cfvip ne 1}">
					<td><input type="checkbox" disabled="disabled" ></td>
					</c:if>
					<c:if test="${examOrder.cfsubscriberesult eq 1}">
					<td>预约成功</td>
					</c:if>
					<c:if test="${examOrder.cfsubscriberesult eq 2}">
					<td>预约失败</td>
					</c:if>
					<td>${examOrder.cfmobile}</td>
					<td>${examOrder.cfphone}</td>
					<td>${examOrder.cfarrearage}元</td>
					<c:if test="${examOrder.cfcarbyte eq 1}">
					<td>小车</td>
					</c:if>
					<c:if test="${examOrder.cfcarbyte eq 2}">
					<td>大车</td>
					</c:if>
					<c:if test="${examOrder.cfcarbyte ne 1 && examOrder.cfcarbyte ne 2 }">
					<td></td>
					</c:if>
					<td>${examOrder.cfremark}</td>
					<td>${examOrder.cfnexttime}</td>
					<td>${examOrder.cfreceived}</td>
					<td>${examOrder.cfamount}</td>
					<td>${examOrder.cffavorable}</td>
					<td>${examOrder.cfclazzName}</td>
					<td>${examOrder.cfidcardno}</td>
					<c:if test="${examOrder.cfsex eq 1}">
					<td>男</td>
					</c:if>
					<c:if test="${examOrder.cfsex eq 2}">
					<td>女</td>
					</c:if>
					<c:if test="${examOrder.cfsex ne 1 && examOrder.cfsex ne 2 }">
					<td></td>
					</c:if>
					<td>${examOrder.cftjr}</td>
					<c:if test="${examOrder.cfckbk eq 1}">
					<td>初考</td>
					</c:if>
					<c:if test="${examOrder.cfckbk  eq 2}">
					<td>补考</td>
					</c:if>
					<c:if test="${examOrder.cfckbk ne 1 && examOrder.cfckbk ne 2 }">
					<td></td>
					</c:if>
					<c:if test="${examOrder.cfjnbjj eq 1}">
					<td><input type="checkbox" checked="checked" value="1" disabled="disabled"/></td>
					</c:if>
					<c:if test="${examOrder.cfjnbjj ne 1}">
					<td><input type="checkbox"  value="0" disabled="disabled"/></td>
					</c:if>
					<c:if test="${examOrder.cfdajj eq 1}">
					<td><input type="checkbox" checked="checked" value="1" disabled="disabled"/></td>
					</c:if>
					<c:if test="${examOrder.cfdajj ne 1}">
					<td><input type="checkbox"  value="0" disabled="disabled"/></td>
					</c:if>
					<td>
						<img alt="" height="11px" src="<%=path%>/images/list/xg.png">
						<a href="<%=path%>/DrivingSys/selectExamOrderByFid?fid=${examOrder.fid}" class="tablelink">修改</a>&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;<img alt="" height="11px" src="<%=path%>/images/list/sc.png">
						<a onclick="delExamOrder('${examOrder.fid}')" class="tablelink">删除</a>&nbsp;&nbsp;&nbsp;
				    </td>
				</tr>
			</c:forEach>
			<%--信息总条目数 rhc--%>
			<tr>
				<td>合计:</td>
				<td>${messageAmount}</td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>

		</table>
		</div>
<div id="location_bottom">
		<pg:pager items="${pb.tr}" url="${pb.url}" export="offset,currentPageNumber=pageNumber" maxPageItems="${pb.ps}">
			   <pg:param name="cfstudentname" value="${examOrder1.cfstudentname}"/>
    		   <pg:param name="cfmobile" value="${examOrder1.cfmobile}"/>
    		   <pg:param name="cfidcardno" value="${examOrder1.cfidcardno}"/>
			   <pg:param name="cfbilltype" value="${examOrder1.cfbilltype}"/>
    		   <pg:param name="beginTime" value="${beginTime}"/> 
    		   <pg:param name="endTime" value="${endTime}"/>   
            <pg:index>  
               <pg:first>
               <a href="${pageUrl}&&type=${type}" >
               <nobr>
               [首页]
               </nobr>
              </a>   
               </pg:first>  
               <pg:prev><a href="${pageUrl}&&type=${type}">前一页</a></pg:prev>  
               <pg:pages>  
                     <c:choose>  
                        <c:when test="${currentPageNumber eq pageNumber}">    
                           <font color="red">${pageNumber }</font>  
                        </c:when>    
                        <c:otherwise>    
                           <a href="${pageUrl}&&type=${type}">${pageNumber}</a>   
                        </c:otherwise>    
                     </c:choose>  
               </pg:pages>  
               <pg:next><a href="${pageUrl}&&type=${type}">下一页</a></pg:next>  
               <pg:last><a href="${pageUrl}&&type=${type}"><nobr>[尾页]</nobr></a></pg:last>  
            </pg:index>      
         </pg:pager>  
</div>
		<div class="tip">
			<div class="tiptop">
                <span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=path%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认对信息删除 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定" />&nbsp; <input
					name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
</body>
<script type="text/javascript" src="<%=path%>/JS/tempJs/tool.js"></script>
<script type="text/javascript" src="<%=path%>/common/rowspan.js"></script>
<script type="text/javascript">

    // $(function () {
    //     $(".tip").css("left",$(".tablelist").width()-1000)
    // })

		$(document).ready(function(){
            fixation_List()
            //合并行
			 /* _w_table_rowspan("#tablelist",2);   */
			/*  _w_table_rowspan("#tablelist",3);   */
            /* 全选功选 */

            var type = "${type}";
            if (type == '0' || type == '' || type == null) {

            } else {
                //alert("添加成功");
                editAlert();
            }


			$('.del').click(function(){
                var spCodesTemp = "";
                $('[name=check]:checked').each(function(i){
                    if(0==i){
                        spCodesTemp = $(this).val();
                    }else{
                        spCodesTemp += (","+$(this).val());
                    }
                });
                if(spCodesTemp==""){
                    alert("请选择单据")
                }else{
				$(".tip").fadeIn(200);
				 $(".sure").click(function(){
					  $(".tip").fadeOut(100); 

				      location.href='<%=path%>/DrivingSys/deleteExamOrderByFid?fid='+spCodesTemp
				 })
			}
					  $(".cancel").click(function(){
						  $(".tip").fadeOut(100);
						});
				
			})
			
			$('.examOrder').live('dblclick',function(){
			 var fid=$(this).find('input:checkbox').val()
                gotoSelectCard(this,'/DrivingSys/selectExamOrderByFid?fid='+fid);

                //location.href='<%=path%>/DrivingSys/selectExamOrderByFid?fid='+fid
			})
			
			
			$('.update').click(function(){
				var spCodesTemp = "";
                $('[name=check]:checked').each(function(i){
			       if(0==i){
			        spCodesTemp = $(this).val();
			       }else{
			        spCodesTemp += (","+$(this).val());
			       }
			      });  	
			      if(spCodesTemp==""){
			    	  alert("请选择学员")
			      }else{
			      var fid=spCodesTemp.split(",")[0]
			      location.href='<%=path%>/DrivingSys/selectExamOrderByFid?fid='+fid
			      }
			})
			
		/* 全选功选 */
            //全选全不选
            $(".check").click(function(){
                if(this.checked){
                    $("[name=check]").attr("checked",true);}
                else{ $("[name=check]").attr("checked",false);}
            })
		})
		
    function delExamOrder(deleteId){
        $(".tip").animate(({top: $(window).scrollTop()+250}))
        $(".tip").fadeIn(200);
        $('.window-mask').fadeToggle()
	  $(".sure").click(function(){
	  	$(".tip").fadeOut(100);
          $('.window-mask').fadeOut()
	  	location='<%=path%>/DrivingSys/deleteExamOrderByFid?fid='+deleteId+'';
	  })
	  
	  $(".cancel").click(function(){
          $('.window-mask').fadeOut()
		  $(".tip").fadeOut(100);
		});

	}

	  $('.outExcel').live('click',function () {
            var cfstudentname = $('.seachform').find('input[name=cfstudentname]').val()
            var cfmobile = $('.seachform').find('input[name=cfmobile]').val()
            var cfidcardno = $('.seachform').find('input[name=cfidcardno]').val()
		    var cfbilltype = $('.seachform').find('select[name=cfbilltype]').val()
            var beginTime = $('.seachform').find('input[name=beginTime]').val()
            var endTime = $('.seachform').find('input[name=endTime]').val()
            location = '<%=path%>/DrivingSys/outExamOrderExcel?cfstudentname='+ cfstudentname + '&cfidcardno=' + cfidcardno + '&cfmobile=' + cfmobile  + '&cfbilltype=' + cfbilltype + '&beginTime=' + beginTime + '&endTime=' + endTime
	  })
</script>
</html>